home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_spike.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  111 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_Spike.cog
  4. # Player is killed by shooting spike if he/she steps on face.
  5. #
  6. # [TRM]
  7. #
  8. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13.     message     startup
  14.     message     entered
  15.     message     touched
  16.     message     arrived
  17.         
  18.     thing       player      local
  19.     thing       deadIndy    local
  20.     thing       spike0
  21.     
  22.     surface     hole0
  23.     
  24.     template    tpl_Indy=indy_sh_actor      local
  25.  
  26.     keyframe    inDie=in_die_buckle.key     local
  27.     
  28.     sound       sndSpike=tem_temspikes_activate_c.wav   local
  29.     sound       sndDie=tem_temspikes_up_kill_c.wav      local
  30.     sound       say_Ugh=inxj018a.wav                    local
  31.     
  32.     flex        shootSpeed=5.0
  33.     
  34.     int         deadMan=0       local
  35.     int         up=0            local
  36.     int         safe=0          local
  37.     int         victim            local
  38.     
  39. end
  40.        
  41. # ========================================================================================
  42.  
  43. code
  44.  
  45. startup:
  46.  
  47.     player = GetLocalPlayerThing();
  48.     return;
  49.  
  50. # ========================================================================================
  51.  
  52. entered:
  53.  
  54.     if((GetSenderRef() == hole0) && (up == 0))
  55.     {
  56.         up = 1;
  57.         
  58.         PlaySoundLocal(sndSpike, 1.0, 0.0, 0x0, 0);
  59.         MoveToFrame(spike0, 1, shootSpeed);
  60.     }
  61.         
  62.     return;
  63.  
  64. # ========================================================================================
  65.  
  66. touched:
  67.  
  68.     if((deadMan == 1) || (safe == 1)) return;
  69.  
  70.     if((GetSenderRef() == spike0) && (safe == 0))
  71.     {
  72.         deadMan = 1;
  73.         
  74.         SetCollideType(spike0, 0);
  75.         
  76.         DamageThing(player, 1000.0, 0x1, victim);
  77.         Sleep(0.1);
  78.         
  79.         PlaySoundLocal(sndDie, 1.0, 0.0, 0x0, 0);
  80.         PlaySoundLocal(say_Ugh, 1.0, 0.0, 0x0, 0);
  81.         
  82.         # hide player
  83.         SetThingFlags(player, 0x80000);
  84.         
  85.         deadIndy = CreateThing(tpl_Indy, player);
  86.         CaptureThing(deadIndy);
  87.         
  88.         # Show actor Indy and play Keyframe
  89.         ClearThingFlags(deadIndy, 0x80000);
  90.         PlayKey(deadIndy, inDie, 4, 0x14, 0);
  91.     }
  92.     
  93.     return;
  94.  
  95. # ========================================================================================
  96.  
  97. arrived:
  98.  
  99.     if((up == 1) && (deadMan == 0))
  100.     {
  101.         safe = 1;
  102.     }
  103.     
  104.     return;
  105.     
  106. # ========================================================================================
  107.  
  108. end
  109.  
  110.